
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>编辑信息</title>
		<link rel="stylesheet" type="text/css" href="../static/css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="../static/css/editIM.css"/>
		<link rel="stylesheet" href="../static/css/calendar.css" />

		<script src="../static/js/jquery.js"></script>
		<script type="text/javascript" src="../static/js/calendar.js"></script>
		<script src="../static/js/editIM.js"></script>
		<script src="../static/js/checkUpdateIM.js"></script>
		<script type="text/javascript" src="../static/js/checkUserUpdateForm.js" charset="utf-8"></script>
<style>
	html,body{height: 100%}
</style>
<script>
	var Sid;
	$(function () {
        $.getJSON("/findCropSpecies",{},function (data) {
            var crop=' <option value="">请选择</option>';
            $("#cptypess").empty();
            for (var i=0;i<data.length;i++){
                var c=data[i];
                crop+=' <option value="'+c.id+'">'+c.cropSpecies+'</option>';
            }
            $("#cptypess").append(crop);
        })
		var id=location.href.split("id=")[1];
		Sid=id;
		$.ajax({
			url:"/findOne",
			data:{"id":id},
			type:"post",
			dataType:"json",
			success:function (pojo) {
			    console.log(pojo);
                $("input[name='sample_id']").val(pojo.sampleId);
                $("select[name='crop_category_id']").val(pojo.cropCategoryId);
                $("select[name='breed']").val(pojo.breed);

                $.ajax({
                    url:"/findProvince",
                    dataType:"json",
                    data:{},
                    type:"get",
                    async:false,
                    success:function (data) {
                        var html="<option value=''>请选择</option>";
                        $.each(data,function (index,item){
                            html+="<option value='"+item.code+"'>"+item.name+"</option>"
                        })
                        $("#shen").html(html);
                    }
                })

                $("#shen").val(pojo.province);

                changeCity();

                $("#shi").val(pojo.city);

                changeCounty();

                $("#xian").val(pojo.county);

                $("textarea[name='seasonal']").val(pojo.seasonal);

                var htmltoxin='<option value="0">请选择</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="1">DON</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="2">伏马菌素</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="3">玉米赤霉烯酮</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="4">黄曲霉毒素总量</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="5">黄曲霉毒素B1</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="6">黄曲霉毒素B2</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="7">黄曲霉毒素G1</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="8">黄曲霉毒素G2</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="9">黄曲霉毒素M1</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="10">黄曲霉毒素M2</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="11">展青霉毒素</option>\n' +
                    '\n' +
                    '\t\t\t\t\t\t                        <option value="12">赭曲霉毒素A</option>';
                var htmltpxin='<li class="edittable-middle addions"><div class="editmiddle-left">毒素信息</div><div class="editmiddle-right"><ul><li><lable>毒素种类</lable><select name="toxin_id" id="toxin_id1" onblur="checktoxin_id()">'+htmltoxin+'</select><span id="toxin_id" ></span></li><li><lable>毒素含量</lable><input name="toxin_count" type="text"  onblur="checktoxin_count()"  maxlength="10" placeholder="毒素含量最大可输入十位"/><span id="toxin_count" ></span></li><li><a class="del">删除</a></li></ul></div></li>'
                $.each(pojo.listToxin,function (index,item) {
                    var $html=$(htmltpxin).clone();
                    $($html).find("select[name='toxin_id']").val(item.toxinId)
                    $($html).find("input[name='toxin_count']").val(item.toxinCount)
                    $(".addds").append($html);
                })

                var htmlBs="<li class='edittable-bottom addbds'><input type='hidden'  name='id'><div class='editbottom-left'>产毒菌株信息</div><div class='editbottom-right'><ul><li><lable>样品编号</lable><input id='sample_num' name='sample_num' type='text' class='sample'  value='"+$('.ypbh').val()+"'/></li><li><lable>菌株原始编号</lable><input name='original_num' type='text'  class='num'/><span class='err'></span></li><li class='form-a'><lable>文献信息</lable><a class='xz-btn-a'>选择文件</a> <input type='text' name='wordword' id='' value='' class='file-name-a'  readonly='readonly' placeholder='仅支持doc/docx格式文档'/><input onchange='getPhotoSizes(this)' name='word_addr' type='file' class='file-info-a' accept='.doc,.docx'/></li><li class='form-c'><lable>文本信息</lable><a class='xz-btn-c'>选择文件</a> <input   type='text' name='texttext' id='' value='' class='file-name-c'  readonly='readonly' placeholder='仅支持txt格式'/><input onchange='getTextSize(this)' name='txt_addr' type='file' class='file-info-c' accept='.txt'/></li><li class='form-b'><lable>图片信息</lable><a class='xz-btn-b'>选择文件</a> <input type='text' name='picturef' id='' value='' class='file-name-b'  readonly='readonly' placeholder='仅支持jpg/png格式'/><input onchange='getPhotoSize(this)' name='picture_addr' type='file' class='file-info-b' accept='.png,.jpg,.jpeg'/></li><li><a class='del'>删除</a></li></ul></div></li>"

                $.each(pojo.listBacterial,function (index,item) {
                    var $html=$(htmlBs).clone();
                    $($html).find("input[name='id']").val(item.id)
                    $($html).find("input[name='sample_num']").val(pojo.sampleId)
                    $($html).find("input[name='original_num']").val(item.originalNum)
                    $($html).find("input[name='wordword']").val("已上传")
                    $($html).find("input[name='texttext']").val("已上传")
                    $($html).find("input[name='picturef']").val("已上传")
                    $(".add-con").append($html);
                })
            }
		})
    })
    function sub() {
        var formdata=new FormData();
        var pojo={
            sampleInfo:{
                id:Sid,
                sampleId:$("input[name='sample_id']").val(),
                cropCategoryId:$("select[name='crop_category_id']").val(),
                breed:$("select[name='breed']").val(),
                province:$("select[name='province']").val(),
                city:$("select[name='city']").val(),
                county:$("select[name='county']").val(),
                township:$("input[name='township']").val(),
                village:$("input[name='village']").val(),
                household:$("input[name='household']").val(),
                harvestTime:timefor($("input[name='harvest_time']").val()),
                samplingTime:timefor($("input[name='sampling_time']").val()),
                samplingPeople:$("input[name='sampling_people']").val(),
                pollutionRate:$("input[name='pollution_rate']").val(),
                description:$("textarea[name='description']").val(),
                seasonal:$("textarea[name='seasonal']").val(),
			},
            listToxin: new Array(),
            listBacterial:new Array()
        }
        $.each($(".addions"),function (index,item) {
            pojo.listToxin.push({
                toxinId:$(item).find("select[name='toxin_id']").val(),
                toxinCount:$(item).find("input[name='toxin_count']").val()
            })
        })
        $.each($(".addbds"),function (index,item) {
            pojo.listBacterial.push({
                id:$(item).find("input[name='id']").val(),
                sampleNum:$(item).find("input[name='sample_num']").val(),
                originalNum:$(item).find("input[name='original_num']").val(),
                wordAddr:$(item).find("input[name='wordword']").val()=="已上传"?0:1,
                txtAddr:$(item).find("input[name='texttext']").val()=="已上传"?0:1,
                pictureAddr:$(item).find("input[name='picturef']").val()=="已上传"?0:1
            })
            if($(item).find("input[name='wordword']").val()!="已上传")formdata.append("fileList",$(item).find("input[name='word_addr']")[0].files[0]);
            if($(item).find("input[name='texttext']").val()!="已上传")formdata.append("fileList",$(item).find("input[name='txt_addr']")[0].files[0]);
            if($(item).find("input[name='picturef']").val()!="已上传")formdata.append("fileList",$(item).find("input[name='picture_addr']")[0].files[0]);

        })
        formdata.append("JsonPojo",JSON.stringify(pojo));

        console.log(pojo);
        $.ajax({
            url:"/update",
            data:formdata,
            dataType:"json",
            type:"post",
            processData: false,
            contentType: false,
            cache: false,
            success:function (datas) {
                alert(datas);
                // history.go(-1);
            }
        })
    }
    function changeCity() {
        $.ajax({
            url:"/findCityByProvince",
            dataType:"json",
            data:{"code":$("#shen").val()},
            type:"get",
            async:false,
            success:function (data) {
                var html="<option value=''>请选择</option>";
                $.each(data,function (index,item){
                    html+="<option value='"+item.code+"'>"+item.name+"</option>"
                })
                $("#shi").html(html);
            }
        })
    }
    function changeCounty() {
        $.ajax({
            url:"/findCountyByCity",
            dataType:"json",
            data:{"code":$("#shi").val()},
            type:"get",
            async:false,
            success:function (data) {
                var html="<option value=''>请选择</option>";
                $.each(data,function (index,item){
                    html+="<option value='"+item.code+"'>"+item.name+"</option>"
                })
                $("#xian").html(html);
            }
        })
    }
    function timefor(time) {
        var timelist=time.split("-");
        var newtime=timelist[0];
        if(timelist[1].length==1)newtime+="-0"+timelist[1];
        else newtime+="-"+timelist[1]
        if(timelist[2].length==1)newtime+="-0"+timelist[2];
        else newtime+="-"+timelist[2]
        return newtime;
    }
</script>
	</head>
	<body>
		<div class="contaner">

			<div class="im-content">
				<div class="im-heade">
					<div class="imhead-title">当前页面：<a>修改信息</a></div>
				</div>
	<form action="editinformation" id="search_form" enctype="multipart/form-data" method="post" accept-charset="utf-8">
				<div class="editim-table">
					<ul class="table-con">
						<li class="edittable-top">
							<div class="edittable-left">采样信息</div>
							<div class="edittable-right">
								<ul>
									<li>
										<lable>样品编号</lable>
										<input name="sample_id" placeholder="首字母为英文，长度为5-15位" id="" class="ypbh" value="W7410002" type="">
										<span id="sample_id"></span>
									</li>
									<li>
									<input name="id" id="" value="19" type="hidden">
										<lable>农产品加工原料类别</lable>
										<select class="sel"  name="crop_category_id" id="cptype">

								        	<option value="1" >水果类</option>

								        	<option value="2">谷物类</option>

								        	<option value="3">油料类</option>

								        	<option value="4">坚果类</option>

								        	<option value="5">香辛类</option>

								        	<option value="6">饲料类</option>

								        	<option value="7">鸡</option>

										</select>
										<span id="crop_category_id"></span>
									</li>
									<li>
										<lable>品种</lable>
										<select name="breed" class="sele" id="cptypess">
											<option class="selec" value="6" selected="selected">苹果</option>
										</select>
										<span id="breed"></span>
									</li>
									<li>
										<div class="width">
											 <lable>地点</lable>
							  <!--<input value="北京" id="shengs" type="hidden">-->
							  <!--<input value="北京市" id="shisss" type="hidden">-->
							  <!--<input value="东城区" id="xiansss" type="hidden">-->
							  <!--<input value="北京" name="province" id="provinces" type="hidden">-->
							  <!--<input value="北京市" name="city" id="city" type="hidden">-->
							  <!--<input value="东城区" name="county" id="county" type="hidden">-->
							   <input value="123" id="wsx" type="hidden">
	                             <select class="province" id="shen" name="province" >


				        		</select><span>省</span>
				        		<select class="city"  id="shi" name="city" ></select><span>市</span>
				        		<select  name="county" id="xian" onchange="xianwsx()"></select><span>县</span>
										</div>
										<span class="xc">
											<input placeholder="可为空" id="xiang" name="township" value="" type="text">乡
											<input placeholder="可为空" id="cun" name="village" value="" type="text">村
											<input placeholder="可为空" id="hu" name="household" value="" type="text"><span>户</span>
										</span>
										<span id="province"></span>
									</li>
									<li>
										<lable>收获时间</lable>
										<input name="harvest_time" value="2018-03-08" id="dt" placeholder="选择日期" readonly="readonly" type="text">
  										<div style="width: 280px; height: 330px; left: 549.65px; top: 357px; z-index: 999; display: none;" class="calendar calendar-modal calendar-d" id="dd"><div style="width: 280px;" class="calendar-inner"><div class="calendar-views"><div style="width: 280px;" class="view view-date"><div class="calendar-hd"><a href="javascript:;" data-calendar-display-date="" class="calendar-display">2018/<span class="m">3</span></a><div class="calendar-arrow"><span class="prev" title="上一月" data-calendar-arrow-date="">&lt;</span><span class="next" title="下一月" data-calendar-arrow-date="">&gt;</span></div></div><div style="width: 280px; height: 280px;" class="calendar-ct"><ol class="week"><li style="width:40px;height:40px;line-height:40px">日</li><li style="width:40px;height:40px;line-height:40px">一</li><li style="width:40px;height:40px;line-height:40px">二</li><li style="width:40px;height:40px;line-height:40px">三</li><li style="width:40px;height:40px;line-height:40px">四</li><li style="width:40px;height:40px;line-height:40px">五</li><li style="width:40px;height:40px;line-height:40px">六</li></ol><ul class="date-items"><li style="width: 280px;"><ol class="days"><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">29</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">30</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">31</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">5</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">6</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">7</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">8</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">9</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">10</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">11</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">12</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">13</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">14</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">15</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">16</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">17</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">18</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">19</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">20</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">21</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">22</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">23</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">24</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">25</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">26</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">27</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">5</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">6</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">7</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">8</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">9</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">10</li></ol></li><li style="width: 280px;"><ol class="days"><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">25</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">26</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">27</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">5</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">6</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">7</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">8</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">9</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">10</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">11</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">12</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">13</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">14</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">15</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">16</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">17</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">18</li><li style="width:40px;height:40px;line-height:40px" class=" now" data-calendar-day="">19</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">20</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">21</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">22</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">23</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">24</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">25</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">26</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">27</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">29</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">30</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">31</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">5</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">6</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">7</li></ol></li><li style="width: 280px;"><ol class="days"><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">25</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">26</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">27</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">29</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">30</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">31</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">5</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">6</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">7</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">8</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">9</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">10</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">11</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">12</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">13</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">14</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">15</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">16</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">17</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">18</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">19</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">20</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">21</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">22</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">23</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">24</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">25</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">26</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">27</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">29</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">30</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">5</li></ol></li></ul></div></div><div style="width: 280px;" class="view view-month"><div class="calendar-hd"><a href="javascript:;" data-calendar-display-month="" class="calendar-display">2018</a><div class="calendar-arrow"><span class="prev" title="上一年" data-calendar-arrow-month="">&lt;</span><span class="next" title="下一年" data-calendar-arrow-month="">&gt;</span></div></div><ol style="width: 280px; height: 280px;" class="calendar-ct month-items"><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">1月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">2月</li><li class="now" style="width:70px;height:70px;line-height:70px" data-calendar-month="">3月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">4月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">5月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">6月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">7月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">8月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">9月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">10月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">11月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">12月</li></ol></div></div></div><div class="calendar-label"><p>HelloWorld</p><i></i></div></div>
										<span id="harvest_time"></span>
									</li>
									<li>
										<lable>取样时间</lable>
										<input name="sampling_time" value="2018-03-16" id="dt-b" placeholder="选择日期" readonly="readonly" type="text">
  										<div style="width: 280px; height: 330px; left: 549.65px; top: 401px; z-index: 999; display: none;" class="calendar calendar-modal calendar-d" id="dd-b"><div style="width: 280px;" class="calendar-inner"><div class="calendar-views"><div style="width: 280px;" class="view view-date"><div class="calendar-hd"><a href="javascript:;" data-calendar-display-date="" class="calendar-display">2018/<span class="m">3</span></a><div class="calendar-arrow"><span class="prev" title="上一月" data-calendar-arrow-date="">&lt;</span><span class="next" title="下一月" data-calendar-arrow-date="">&gt;</span></div></div><div style="width: 280px; height: 280px;" class="calendar-ct"><ol class="week"><li style="width:40px;height:40px;line-height:40px">日</li><li style="width:40px;height:40px;line-height:40px">一</li><li style="width:40px;height:40px;line-height:40px">二</li><li style="width:40px;height:40px;line-height:40px">三</li><li style="width:40px;height:40px;line-height:40px">四</li><li style="width:40px;height:40px;line-height:40px">五</li><li style="width:40px;height:40px;line-height:40px">六</li></ol><ul class="date-items"><li style="width: 280px;"><ol class="days"><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">29</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">30</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">31</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">5</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">6</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">7</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">8</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">9</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">10</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">11</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">12</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">13</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">14</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">15</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">16</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">17</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">18</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">19</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">20</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">21</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">22</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">23</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">24</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">25</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">26</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">27</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">5</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">6</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">7</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">8</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">9</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">10</li></ol></li><li style="width: 280px;"><ol class="days"><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">25</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">26</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">27</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">5</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">6</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">7</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">8</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">9</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">10</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">11</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">12</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">13</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">14</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">15</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">16</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">17</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">18</li><li style="width:40px;height:40px;line-height:40px" class=" now" data-calendar-day="">19</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">20</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">21</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">22</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">23</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">24</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">25</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">26</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">27</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">29</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">30</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">31</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">5</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">6</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">7</li></ol></li><li style="width: 280px;"><ol class="days"><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">25</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">26</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">27</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">29</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">30</li><li style="width:40px;height:40px;line-height:40px" class="old" data-calendar-day="">31</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">5</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">6</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">7</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">8</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">9</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">10</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">11</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">12</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">13</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">14</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">15</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">16</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">17</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">18</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">19</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">20</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">21</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">22</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">23</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">24</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">25</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">26</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">27</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">28</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">29</li><li style="width:40px;height:40px;line-height:40px" class="" data-calendar-day="">30</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">1</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">2</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">3</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">4</li><li style="width:40px;height:40px;line-height:40px" class="new" data-calendar-day="">5</li></ol></li></ul></div></div><div style="width: 280px;" class="view view-month"><div class="calendar-hd"><a href="javascript:;" data-calendar-display-month="" class="calendar-display">2018</a><div class="calendar-arrow"><span class="prev" title="上一年" data-calendar-arrow-month="">&lt;</span><span class="next" title="下一年" data-calendar-arrow-month="">&gt;</span></div></div><ol style="width: 280px; height: 280px;" class="calendar-ct month-items"><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">1月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">2月</li><li class="now" style="width:70px;height:70px;line-height:70px" data-calendar-month="">3月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">4月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">5月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">6月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">7月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">8月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">9月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">10月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">11月</li><li style="width:70px;height:70px;line-height:70px" data-calendar-month="">12月</li></ol></div></div></div><div class="calendar-label"><p>HelloWorld</p><i></i></div></div>

									</li>
									<li>
										<lable>取样人</lable>
										<input placeholder="请输入取样人姓名" name="sampling_people" id="" value="刘德辉李忠博" type="">
										<span id="sampling_people"></span>
									</li>
									<li class="jijie">
										<lable>采集季节及气候特征</lable>
										<textarea name="seasonal" id="seasonal1" rows="" cols="">阿萨德</textarea>
										<span id="seasonal"></span>
									</li>
									<li class="huanjing">
										<lable>采集地、环境信息描述</lable>
										<textarea name="description" id="description1" rows="" cols="">阿萨德</textarea>
										<span id="description"></span>
									</li>
									<li>
										<lable>真菌污染率</lable>
										<input name="pollution_rate" id="" value="12.0" type="">
										<span id="pollution_rate"></span>
									</li>
								</ul>
							</div>
						</li>
						<div class="addds">

					<!--	<li class="edittable-middle">
							<div class="editmiddle-left">
								毒素信息
							</div>
							<div class="editmiddle-right">
								<ul>
									<li>
										<lable>毒素种类</lable>
										<select name="toxin_id" id="toxin_id1">
											<option value="">请选择</option>

									      <option value="1 " selected="selected">DON</option>

									      <option value="2 ">伏马菌素</option>

									      <option value="3 ">玉米赤霉烯酮</option>

									      <option value="4 ">黄曲霉毒素总量</option>

									      <option value="5 ">黄曲霉毒素B1</option>

									      <option value="6 ">黄曲霉毒素B2</option>

									      <option value="7 ">黄曲霉毒素G1</option>

									      <option value="8 ">黄曲霉毒素G2</option>

									      <option value="9 ">黄曲霉毒素M1</option>

									      <option value="10 ">黄曲霉毒素M2</option>

									      <option value="11 ">展青霉毒素</option>

									      <option value="12 ">赭曲霉毒素A</option>

										</select>
										<span id="toxin_id"></span>
									</li>
									<li>
										<lable>毒素含量</lable>
										<input name="toxin_count" value="12.0" type="text">
										<input name="edittoxin_id" value="29" type="hidden">
										<span id="toxin_count"></span>
									</li>
									<li>
										<a onclick="qwe();" class="del">删除</a>
									</li>
								</ul>
							</div>
						</li>-->

						</div>
						<div class="add-dsxx">+添加毒素信息</div>
						<div class="add-con">


					<!--	<li class="edittable-bottom">

							<div class="editbottom-left">产毒菌株信息196</div>
							<div class="editbottom-right">
								<ul>
									<li>
										<lable>样品编号</lable>
										<input name="sample_num" value="W7410002" class="sample" type="text">


									</li>
									<li>
										<lable>菌株原始编号</lable>
										<input name="original_num" value="dsadsaddsad" class="num" type="text">

									</li>
									<li class="form-a">

											<lable>文献信息</lable>
											<a class="xz-btn-a">选择文件</a>
											<input placeholder="仅支持doc/docx格式" name="wordvalues" id="" value="/upload/word/20180316104347202.docx" class="file-name-a" readonly="readonly" type="text">
											<input name="word_addr" class="file-info-a" type="file">

									</li>
									<li class="form-b">

											<lable>文本信息</lable>
											<a class="xz-btn-b">选择文件</a>
											<input placeholder="仅支持txt格式" value="/upload/txt/20180316104347878.txt" name="txtvalues" id="" class="file-name-b" readonly="readonly" type="text">
											<input name="txt_addr" value="0" class="file-info-b" type="file">

									</li>
									<li class="form-c">

											<lable>图片信息</lable>
											<a class="xz-btn-c">选择文件</a>
											<input placeholder="仅支持jpg/png格式" value="/upload/img/20180316104347957.png" name="imgvalues" id="" class="file-name-c" readonly="readonly" type="text">
											<input name="picture_addr" value="0" class="file-info-c" type="file">

									</li>
									<li>
										<a onclick="qwe(6);" class="del">删除</a>
									</li>
								</ul>
							</div>

						</li>-->


						</div>
					</ul>
					<div class="add-ds">+添加产毒菌株信息</div>
					<div class="footer">
						<a class="baocun" onclick="sub()">修改</a>
						<a onclick="history.go(-1)" class="marginl" href="javascript:if(confirm('确实要放弃操作吗?返回之后，所添加数据不会保存！'))location='/glory/rest/iddeleteyangpin?id=754'">返回</a>
					</div>
				</div>
			</form>
			</div>
		</div>
		</div>
	</body>



<!--	<script>

	function getPhotoSize(obj){
    photoExt=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();//获得文件后缀名
    console.log(photoExt);
     if(photoExt!='.png' && photoExt!='.jpg'){
        alert("请上传正确的照片格式!");
         obj.value = "";
        console.log(obj.value);
        return false;
    }
    var fileSize = 0;
    var isIE = /msie/i.test(navigator.userAgent) && !window.opera;
    if (isIE && !obj.files) {
         var filePath = obj.value;
         var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
         var file = fileSystem.GetFile (filePath);
         fileSize = file.Size;
    }else {
         fileSize = obj.files[0].size;
    }
    fileSize=Math.round(fileSize/1024*100)/100; //单位为KB


}

function getPhotoSizes(obj){
    photoExt=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();//获得文件后缀名
     if(photoExt!='.doc' && photoExt!='.docx'){
        alert("请上传正确的文档格式!");
         obj.value = "";
        console.log(obj.value);
        return false;
    }
    var fileSize = 0;
    var isIE = /msie/i.test(navigator.userAgent) && !window.opera;
    if (isIE && !obj.files) {
         var filePath = obj.value;
         var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
         var file = fileSystem.GetFile (filePath);
         fileSize = file.Size;
    }else {
         fileSize = obj.files[0].size;
    }
    fileSize=Math.round(fileSize/1024*100)/100; //单位为KB


}

function getTextSize(obj){
// 	alert("校验txt");
    photoExt=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();//获得文件后缀名
     if(photoExt!='.txt'){
        alert("请上传正确的文档格式!");
         obj.value = "";
        console.log(obj.value);
        return false;
    }
    var fileSize = 0;
    var isIE = /msie/i.test(navigator.userAgent) && !window.opera;
    if (isIE && !obj.files) {
         var filePath = obj.value;
         var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
         var file = fileSystem.GetFile (filePath);
         fileSize = file.Size;
    }else {
         fileSize = obj.files[0].size;
    }
    fileSize=Math.round(fileSize/1024*100)/100; //单位为KB


}
function cptypes(){
		    var oSelect = document.getElementById('cptype');
            var cid = oSelect.value;

		if(cid != ""){

				$.ajax({
				 type:"POST",   //http请求方式
				 url:"selectidtype", //发送给服务器的url
				 dataType:"json",    //传参类型
				 data:{cid:cid},
				 success: function(cc) {

					if($(".selec").length == "0"){
						$("#cptypess").append("<option class='selec' value='' >"+"请选择"+"</option>");
						 for(var i=0 ;i<cc.length ;i++){

						 	$("#cptypess").append(
						 		"<option class='cpzl'  value='" +cc[i].id+ "' >"+cc[i].crop_species+"</option>"
						 	);
						 }
					}else{
						$(".selec").remove();
							$("#cptypess").append("<option class='selec' value='' >"+"请选择"+"</option>");
						 for(var i=0 ;i<cc.length ;i++){

						 	$("#cptypess").append(
						 		"<option class='selec'  value='" +cc[i].id+ "' >"+cc[i].crop_species+"</option>"
						 	);
						 }

					}
				 }
			 });
		}else{
			alert("强选择原料类别！！！");
		}
	}

	</script>-->
</html>
